package y23.Sep;


class Animal{
    private String name;
    private int age;
    private String color;
    public  String food;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Animal(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public String eat(){
        System.out.println(name + "正在吃" + this.food);
        return null;
    }

}

class Dog extends Animal{

    public Dog(String name, int age, String color) {
        super(name, age, color);
    }

    public String eat(){
        System.out.println( getName()+ "正在吃" + this.food);
        return null;
    }

}

class fish extends Animal{

    public fish(String name, int age, String color) {
        super(name, age, color);
    }
}

class bird extends Animal{

    public bird(String name, int age, String color) {
        super(name, age, color);
    }
}

public class eg1 {
    public static void main(String[] args) {
        Animal animal1 = new Dog("小狗",10,"黄色");
        System.out.println(animal1.eat());
    }
}
